<template>
    <div class="container">
      <div class="banner" @click="handlerGallery" v-show="!showGallery">
        <img class="banner-img" src="http://img1.qunarzz.com/sight/p0/1803/ae/ae876a8017aeadefa3.img.jpg_600x330_6decc94a.jpg" alt="">
        <div class="banner-back">
          <div class="iconfont back">&#xe624;</div>
        </div>
        <div class="banner-info">
          <div class="banner-title">灵山小镇拈花湾</div>
          <div class="banner-number">
            <span class="iconfont banner-icon">&#xe6d5;</span>
            <span>20</span>
          </div>
        </div>
      </div>
      <common-gallery :galleryList="galleryList" v-show="showGallery" @showDetail="showDetail"></common-gallery>
    </div>
</template>

<script>
import commonGallery from 'common/Gallery'

export default {
  name: 'Banner',
  props: {
    galleryList: Array
  },
  components: {
    commonGallery
  },
  data () {
    return {
      showGallery: false
    }
  },
  methods: {
    handlerGallery () {
      this.$emit('hideDetail')
      this.showGallery = true
    },
    showDetail () {
      this.showGallery = false
      this.$emit('showDetail')
    }
  }

}
</script>

<style lang="stylus" scoped>
  .banner
    position relative
    overflow hidden
    width 100%
    height 0
    padding-bottom 55%
    .banner-back
      position absolute
      top .1rem
      left .1rem
      width 0
      height 0
      border .35rem #5c6e7e solid
      border-radius 1rem
      .back
        position absolute
        right  -.1rem
        top -.15rem
        color #ffffff
        font-size .3rem
    .banner-img
      width 100%
    .banner-info
      font .32rem '微软雅黑'
      color #f5ffff
      display flex
      justify-content space-between
      width 100%
      position absolute
      bottom 0
      background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5))
      .banner-title
        margin-bottom .15rem
        margin-left .1rem
      .banner-number
        font-size .3rem
        background rgba(0,0,0,.5)
        border-radius .2rem
        width 1rem
        text-align center
        padding-top .03rem
        margin-bottom .1rem
        margin-right .1rem
        .banner-icon
          font-size .25rem
</style>
